package com.csw01;

import com.util.JDBCUtil;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class testJDBCUtil {
    public static void main(String[] args) throws Exception {
        Connection connection = JDBCUtil.getConnection();
        String sql="select * from student";
        PreparedStatement ps = connection.prepareStatement(sql);
        ResultSet rs = ps.executeQuery();
        while (rs.next()){
            String name = rs.getString("name");
            System.out.println(name);
        }
        JDBCUtil.closeALL(rs,ps,connection);
    }
}
